<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml" xmlns:shiro="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" type="text/css" herf="/css/bootstrap.min.css">
</head>
<body>
<input id="codeUrl" type="text" th:value="${url}" hidden="hidden"/>
<div id="all" style="width: 230px;height: 80px;float: left">
    <div id="qrcode" style="float: left;border: 2px black solid ;
        border-right: 0;
        padding: 5px;"></div>
    <div class="text">
        <style>
            table,table tr th, table tr td {
                border:2px solid black;
            }
            table{
                text-align: center;
                border-collapse: collapse; padding:2px;
            }
            .businessCard{
                width: 140px;
                height: 84px;
                border: 2px;
                cellpadding: 0;
                border-left: 0;
                font-size: 12px;
            }
        </style>
        <table class="businessCard">
            <tr>
                <td width="70px">
                    公司名称 :
                </td>
                <td width="60px" >普诚科技</td>
            </tr>

            <tr>
                <td>
                    资产编号 :
                </td>
                <td width="60px" th:text="${propertyNumber}"></td>
            </tr>
            <tr>
                <td>
                    资产名称 :
                </td>
                <td width="60px" th:text="${propertyName}"></td>
            </tr>
            <tr>
                <td>
                    配置信息 :
                </td>
                <td width="60px" th:text="${configurationInfo}"></td>
            </tr>
        </table>
    </div>
</div>
<div>
    <div class="btn-group-sm" id="toolbar" role="group">
        <button type="button" class="btn btn-primary" onclick="clickPrint()">打印</button>
    </div>
</div>

<script type="text/javascript" src="/js/qrcodejs-master/qrcode.js"></script>
<script type="text/javascript" >

    // new QRCode(document.getElementById("qrcode"), "https://github.com/davidshimjs/qrcodejs");
    var url = document.getElementById("codeUrl").value;
    console.log(url)
    var qrcode = new QRCode(document.getElementById("qrcode"), {
        text: url,
        width: 70,
        height: 70,
        // colorDark : "#f60",
        // colorLight : "#ccc",
        correctLevel : 3 ,// 二维码结构复杂性 0~3
    });

    function clickPrint() {
        var all = document.body.innerHTML;
        document.body.innerHTML = document.getElementById('all').innerHTML;
        window.print();

        document.body.innerHTML = all;
    }

</script>
<style>
    /*#all{*/
        /*float: left;*/
        /*width: 100px;*/
        /*height: 142px;*/
    /*}*/
    #qrcode{
        float: left;
        border: 2px black solid ;
        border-right: 0;
        padding: 5px;
    }
/*    .businessCard{
        width: 222px;
        height: 142px;
        border: 2px;
        cellpadding: 0;
        border-left: 0;
    }
    table,table tr th, table tr td {
        border:2px solid black;
    }*/
/*    table{
        200px;min-height: 25px; line-height: 25px; text-align: center; border-collapse: collapse; padding:2px;
    }*/
</style>
</body>
</html>

